function sendMsg(obj) {
    var seq=Math.round(Math.random()*10000);
    var rand=Math.round(Math.random()*10000);
    var time=Date.parse(new Date())/1000;
    var nickname=sessionStorage.getItem("nickname");
    var mobile=sessionStorage.getItem("mobile");
    var sess=new webim.Session(
        webim.SESSION_TYPE.C2C,
        obj.toid,
        obj.tonickname,
        "",
        time,
        seq,
    );
    var msg=new webim.Msg(
        sess,
        true,
        -1,
        rand,
        time,
        mobile,
        webim.C2C_MSG_SUB_TYPE.COMMON,
        nickname
    );
    var textElem=new webim.Msg.Elem.Text(obj.text);
    msg.addText(textElem);
    console.log(msg);
    webim.sendMsg(msg,function (res) {
        console.log(res);
    },function (err) {
        console.log(err);
    });

}